#!/bin/sh
# encoding=utf-8


class Record:

    def loadDataSet(self):

        posting_list = [['my', 'dog', 'has', 'flea',  'problems',  'help', 'please'],
                   ['maybe', 'not', 'take', 'him', 'to', 'dog', 'park', 'stupid'], 
                   ['my', 'dalmation', 'is', 'so', 'cute', 'I', 'love', 'him'], 
                   ['stop', 'posting', 'stupid', 'worthless', 'garbage'], 
                   ['mr', 'licks', 'ate', 'my', 'steak', 'how', 'to', 'stop', 'him'], 
                   ['quit', 'buying', 'worthless', 'dog', 'food', 'stupid']]

        class_vec=[0, 1, 0, 1, 0, 1]  #1-bad 0-good
        return posting_list, class_vec

    def createVecList(self,dataSet):
        vocab_set = set([])  #调用set方法，创建一个空集，将所有的词组成一个集合
        for document in dataSet:
            vocab_set = vocab_set|set(document)
        return list(vocab_set)

    def setOfWor(self):
        print("")

